package cn.source.zk.service.impl;

import cn.source.zk.domain.entity.DeviceDetails;
import cn.source.zk.mapper.ZkDeviceDetailsMapper;
import cn.source.zk.service.IZkDeviceDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZkDeviceDetailServiceImpl implements IZkDeviceDetailService {


    @Autowired
    private ZkDeviceDetailsMapper deviceDetailsMapper;

    /**
     * 插入数据
     * @param deviceDetails
     * @return
     */
    public int add(DeviceDetails deviceDetails) {
        deviceDetailsMapper.add(deviceDetails);
        return 0;
    }


    /**
     * 根据num查询设备明细
     * @param num
     * @return
     */
    public DeviceDetails getByDevId(Long devId) {

        return deviceDetailsMapper.getByDevId(devId);
    }

    /**
     * 修改设备明细
     * @param deviceDetails
     * @return
     */
    public int edit(DeviceDetails deviceDetails) {
        return deviceDetailsMapper.edit(deviceDetails);
    }

    /**
     * 根据devId删除
     * @param devIds
     */
    public int removeBatch(List<Long> devIds) {
        return deviceDetailsMapper.removeBatch(devIds);
    }
}
